import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/css/reset.css'
import './assets/fonts/fonts.css'
import './style.css'
import store from './store'//引入pinia仓库
import axios from './utils/request.js'
import { loadStyle,loadScript,iconfontUrl,iconfontVersion,svgfontUrl  } from './assets/iconfont/iconfont.js' //创建阿里小图标的方法
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import components from './components/global/index.js';
const app=createApp(App)
app.config.warnHandler = () => null //去除控制台的warn 信息
app.config.globalProperties.$http = axios;
app.use(router)
app.use(store); // 使用pinia Store
for (const i in components) { //注册全局组件
  app.component(i, components[i])
}
app.use(ElementPlus, {
  locale: zhCn,
})
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
    loadStyle(iconfontUrl.replace('$key', ele));
})

iconfontVersion.forEach(ele => {
	loadScript(svgfontUrl.replace('$key', ele));
})

app.mount('#app')
